{
  "dataset_reader": {
    "class_name": "sq_reader",
    "data_path": "{DOWNLOADS_PATH}/rel_ranking_eng/lcquad_rel_ranking.pickle"
  },
  "dataset_iterator": {
    "class_name": "basic_classification_iterator",
    "seed": 42
  },
  "chainer": {
    "in": ["question", "rel_list"],
    "in_y": ["y"],
    "pipe": [
      {
        "class_name": "torch_transformers_preprocessor:RelRankingPreprocessor",
        "vocab_file": "{TRANSFORMER}",
        "do_lower_case": true,
        "max_seq_length": 64,
        "add_special_tokens": ["<q>", "</q>", "<rel_sep>"],
        "in": ["question", "rel_list"],
        "out": ["bert_features"]
      },
      {
        "id": "classes_vocab",
        "class_name": "simple_vocab",
        "fit_on": ["y"],
        "save_path": "{MODEL_PATH}/classes.dict",
        "load_path": "{MODEL_PATH}/classes.dict",
        "in": ["y"],
        "out": ["y_ids"]
      },
      {
        "in": ["y_ids"],
        "out": ["y_onehot"],
        "class_name": "one_hotter",
        "depth": "#classes_vocab.len",
        "single_vector": true
      },
      {
        "class_name": "torch_transformers_classifier:TorchTransformersClassifierModel",
        "n_classes": "#classes_vocab.len",
        "return_probas": "true",
        "num_special_tokens": 3,
        "pretrained_bert": "{TRANSFORMER}",
        "save_path": "{MODEL_PATH}/model",
        "load_path": "{MODEL_PATH}/model",
        "optimizer": "AdamW",
        "optimizer_parameters": {
          "lr": 1e-05
        },
        "learning_rate_drop_patience": 5,
        "learning_rate_drop_div": 2.0,
        "in": ["bert_features"],
        "in_y": ["y_ids"],
        "out": ["y_pred_probas"]
      },
      {
        "in": ["y_pred_probas"],
        "out": ["y_pred_ids"],
        "class_name": "proba2labels",
        "max_proba": true
      },
      {
        "in": ["y_pred_ids"],
        "out": ["y_pred_labels"],
        "ref": "classes_vocab"
      }
    ],
    "out": ["y_pred_probas"]
  },
  "train": {
    "epochs": 3,
    "batch_size": 30,
    "metrics": [
      {
        "name": "roc_auc",
        "inputs": [
          "y_onehot",
          "y_pred_probas"
        ]
      },
      "accuracy",
      "f1_macro"
    ],
    "validation_patience": 5,
    "val_every_n_batches": 100,
    "log_every_n_batches": 100,
    "show_examples": false,
    "evaluation_targets": [
      "train",
      "valid",
      "test"
    ],
    "class_name": "torch_trainer"
  },
  "metadata": {
    "variables": {
      "ROOT_PATH": "~/.deeppavlov",
      "DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
      "MODELS_PATH": "{ROOT_PATH}/models",
      "TRANSFORMER": "haisongzhang/roberta-tiny-cased",
      "MODEL_PATH": "{MODELS_PATH}/classifiers/rel_ranking_bert_eng_torch"
    },
    "download": [
      {
        "url": "http://files.deeppavlov.ai/kbqa/wikidata/rel_ranking_bert_eng_torch.tar.gz",
        "subdir": "{MODELS_PATH}/classifiers/rel_ranking_bert_eng_torch"
      },
      {
        "url": "http://files.deeppavlov.ai/kbqa/wikidata/lcquad_rel_ranking.pickle",
        "subdir": "{DOWNLOADS_PATH}/rel_ranking_eng"
      }
    ]
  }
}
